package models.mappers;

import java.util.List;

import org.apache.ibatis.annotations.Select;

import models.SystemAuthority;

public interface SystemAuthorityMapper {
	/**
	 * 根据菜单id查询按钮权限
	 *
	 * @Title: getAuthorityByMenu 
	 * @param menuid
	 * @return
	 * @return: List<SystemAuthority>
	 */
	@Select("select id,btnname,menuid from "
			+ SystemAuthority.TABLE_NAME
			+" where menuid=#{menuid}")
	List<SystemAuthority> getAuthorityByMenu(String menuid);
	/**
	 * 根据用户和菜单id查找按钮权限
	 *
	 * @Title: getAuthorityByOperAndMenu 
	 * @param menuid
	 * @param operatorid
	 * @return
	 * @return: List<SystemAuthority>
	 */
	@Select("select id "
			+ "from authority_view"
			+" where operatorid=#{1} and menuid=#{0}")
	List<String> getAuthorityByOperAndMenu(String menuid,String operatorid);
	@Select("select id "
			+ "from authority_view"
			+ " where operatorid=#{1} and id=#{0}")
	String isExist(String id, String operatorid);
	/**
	 * 通过menu列表获取权限
	 *
	 * @Title: listBymenu 
	 * @param listid
	 * @return
	 * @return: List<SystemAuthority>
	 */
	List<SystemAuthority> listBymenu(List<String> listid);

}
